//https://zhuanlan.zhihu.com/p/555379805





//#include<bits/stdc++.h>
//using namespace std;
//#define all(x) (x).begin(),(x).end()
//#define rall(x) (x).rbegin(),(x).rend()
//const int N = 2e5 + 10;
//#define INF 0x3f3f3f3f;
//typedef long long int ll;
//#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
////----------------------------------------------------------------------------//
//
//
////int main()
////{
////    close();
////    
////    
////
////    return 0;
////}


//#include<bits/stdc++.h>
//using namespace std;
//#define all(x) (x).begin(),(x).end()
//#define rall(x) (x).rbegin(),(x).rend()
//const int N = 2e5 + 10;
//#define INF 0x3f3f3f3f;
//typedef long long int ll;
//#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
////----------------------------------------------------------------------------//
//int n;
//ll sx[410];
//ll sy[410];
//int main()
//{
//    close();
//    cin >> n;
//    for (int i = 1; i <= n; i++)
//    {
//        ll x, y;
//        cin >> x >> y;
//        sx[i] = x;
//        sy[i] = y;
//    }
//
//    ll cnt = 0;
//    for (int i = 1; i <= n; i++)
//    {
//        for (int j = i + 1; j <= n; j++)
//        {
//            for (int k = j + 1; k <= n; k++)
//            {
//                if (sx[i] == sx[j] && sx[j] == sx[k]) continue;
//                if (sy[i] == sy[j] && sy[j] == sy[k]) continue;
//
//                ll a = abs(sx[i] - sx[j]) * abs(sx[i] - sx[j]) + abs(sy[i] - sy[j]) * abs(sy[i] - sy[j]);
//                ll b = abs(sx[i] - sx[k]) * abs(sx[i] - sx[k]) + abs(sy[i] - sy[k]) * abs(sy[i] - sy[k]);
//                ll c = abs(sx[j] - sx[k]) * abs(sx[j] - sx[k]) + abs(sy[j] - sy[k]) * abs(sy[j] - sy[k]);
//                vector<int> v;
//                v.push_back(a);
//                v.push_back(b);
//                v.push_back(c);
//                sort(all(v));
//                if (v[2] < v[0] + v[1]) cnt++;
//            }
//        }
//    }
//
//    cout << cnt << '\n';
//
//    return 0;
//}



#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int N = 2e5 + 10;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
//----------------------------------------------------------------------------//
int n;
double sx[410];
double sy[410];
int main()
{
    close();
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        double x, y;
        cin >> x >> y;
        sx[i] = x;
        sy[i] = y;
    }

    int cnt = 0;
    for (int i = 1; i <= n; i++)
    {
        for (int j = i + 1; j <= n; j++)
        {
            for (int k = j + 1; k <= n; k++)
            {
                if (sx[i] == sx[j] && sx[j] == sx[k]) continue;
                if (sy[i] == sy[j] && sy[j] == sy[k]) continue;

                double a = abs(sx[i] - sx[j]) * abs(sx[i] - sx[j]) + abs(sy[i] - sy[j]) * abs(sy[i] - sy[j]);
                double b = abs(sx[i] - sx[k]) * abs(sx[i] - sx[k]) + abs(sy[i] - sy[k]) * abs(sy[i] - sy[k]);
                double c = abs(sx[j] - sx[k]) * abs(sx[j] - sx[k]) + abs(sy[j] - sy[k]) * abs(sy[j] - sy[k]);
                //cout<<a<<" "<<b<<'\n';
                vector<int> v;
                v.push_back(a);
                v.push_back(b);
                v.push_back(c);
                sort(all(v));
                double ta = (double)sqrt(v[0]);
                double tb = (double)sqrt(v[1]);
                if (v[1] + v[0] + 2 * ta * tb - v[2] > 0) continue;
                if (v[2] == v[0] || v[1] == v[0]) cnt++;
                else if (v[0] == v[1]) cnt++;
                else if (v[0] == v[2]) cnt++;
                else if (v[1] == v[2]) cnt++;
            }
        }
    }

    cout << cnt << '\n';

    return 0;
}